import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_demo/login/login_phone/page.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'action.dart';
import 'state.dart';

Widget buildView(LoginMainState state, Dispatch dispatch, ViewService viewService) {
  ///此插件需要初始化
  ScreenUtil.instance = ScreenUtil(width: 375, height: 667, allowFontScaling: false)..init(viewService.context);
  return Scaffold(
    body:Container(
    alignment: Alignment.center,
    decoration:BoxDecoration(
      image: DecorationImage(
        image: AssetImage("assets/images/auth_module/login_bg.png"),
        fit: BoxFit.cover,
      )
    ) ,
    child: Column(
      children: [
        Container(
          margin: EdgeInsets.only(top: 110),
          child: Image.asset(
              'assets/images/public_module/public_app_logo.png',
            width: 70,
            height: 70,
          )
        ),
        SizedBox(height: 5,),
        Text('券后价',style: TextStyle(color: Color.fromRGBO(47, 47, 47, 1),fontSize: 23),),
        GestureDetector(
          onTap: (){
            Navigator.pushNamed(viewService.context, 'login_phone');
          },
          child: Container(
            height: 45,
            margin: EdgeInsets.only(top: 150,left: 30,right: 30),
            decoration: BoxDecoration(
              borderRadius: BorderRadius.all(Radius.circular(45/2)),
              gradient: LinearGradient(
                begin: Alignment.topLeft,
                end: Alignment.bottomRight,
                colors: [
                  Color.fromRGBO(255, 3, 42, 1),
                  Color.fromRGBO(255, 16, 131, 1)
                ]
              )
            ),
            
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text('使用手机号登录',style: TextStyle(color: Colors.white,fontSize:13 ),),
                Container(
                  margin: EdgeInsets.only(left:7),
                  child: Icon(Icons.chevron_right,color: Colors.white,))
              ],
            ),

        ))
      ],
    ),
  )
  );
}
